from requests import Request, Session
url='https://www.shopbmwmotorcycles.com/Default.aspx/GetInterpretForModal'
def get_year(path):
    s = Session()
    headers = {
        "Content-Type": "application/json;charset=UTF-8",
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate, br",
        "Connection": "keep-alive",
        "Cookie": "ASP.NET_SessionId=x0dkogdjyzj2zwb4l0roke1u",
        "Host": "www.shopbmwmotorcycles.com"
    }
    req = Request(
        url=url,
        method="POST",
        headers=headers
    )
    prepped = req.prepare()
    prepped.body='{"pathUrl":"'+path+'","fitmentLevel":"myGarage"}'
    prepped.headers['Content-Length']=len(prepped.body)
    response = s.send(prepped)
    return response.content.decode("utf8")
